import { defineStore } from "pinia"
export const useBaseConfigStore = defineStore({
  persist: {
    enabled: true,
  },
  id: "useBaseConfigStore",
  state: () => {
    return {
      //团队配置
      teamInfo: {
        name: "", //团队名称
        logo: "", //团队logo
      },

      //主题配置
      theme: {
        //网站静态皮肤{重大哀悼节日}
        gray: "gray-theme",
        dark: "dark-theme",
        light: "light-theme",

        //动态主题皮肤
        blue: "blue-theme",
        green: "green-theme",
        red: "red-theme",
        current: "", //当前主题
      },

      //左侧菜单配置
      slideMenu: {
        //菜单背景色
        slide_menu_bg: "#2f62ff",

        //字体和图标颜色
        slide_menu_font_icon_color: "#2c5700",

        //菜单被选中颜色
        slide_menu_selected_bg: "#2ad61e",
        // 菜单被选中字体和图标颜色
        slide_menu_font_icon_selected_color: "#f80e9a",
      },

      //网站icon 地址
      favicon: "",
    }
  },
  actions: {
    setTeaminfo(key: string, val: string): void {
      this.teamInfo[key] = val
    },

    setTheme(theme: string): void {
      this.theme.current = theme
    },

    setSlidMenu(key: string, color: string): void {
      this.slideMenu[key] = color
    },

    setFavicon(val: string): void {
      this.favicon = val
    },
  },
})
